<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
	<script>
	//1.date对象创建
	var today = new Date();//不写参数时表示当前时间
	console.log(today);//运行结果：date.html:11 Mon Aug 13 2018 10:31:09 GMT+0800 (中国标准时间)
    //MM  DD,YYYY,hh:mm:ss
    var will = new Date("8 15,2018,10:34:28");
    console.log(will);
	</script>
</head>
<body>
	<script>
	// arr=[1,3,5,6,7,8];
	// arr[50]=50;
	 // for(var i=0;i<arr.length;i++){
  //    document.write(arr[i]+"<br/>");
	 // }
	 // for(var i in arr){
  //      document.write(arr[i]+" ");
	 // }
	 //删除 
	 // arr.splice(5,1);
    
    // arr.splice(2,0,"rfger","fg");
    // document.write(arr);
    var arr=new Array(100,7,98);
  //  var arr1=[100,7,98];
    

    // arr[arr.length]=20;//添加方法一
    // arr.splice(3,0,20);//添加方法二
    // arr.splice(2,0,30);
    // arr.splice(1,1);
   

    function pixu(a,b){
     return a-b;
    }
      arr.sort(pixu);
      document.write(arr);
     // var arr2=[1,5,6,2,5,32,4,522,78];
     // var b=arr2.sort(function(a,b){
     // 	if(a>b){
     // 		return 1;
     // 	}else if(a=b){
     // 		return 0;
     // 	}else if(a<b){
     // 		return -1;
     // 	}
     // });
     // console.log(b);
     // 
     
      document.write(arr.join("-"));
        function clock(){
        var today=new Date();
        } 
        var hours=today.getHours();
        var minutes=today.getMinutes();
        var seconds=today.getSeconds();
        var month = today.getMonth();
        var day = today.getDay();
        var t=setInterval(clock,1000);

        function two(hh){
             return hh<10?(hh="0"+hh):(hh=hh);
        }
        document.write(two(hours)+":"+two(minutes)+":"+two(seconds)+(month+1)+day);
	</script>
</body>
</html>